package cn.xxm.ff.log.core.service;


import cn.xxm.ff.log.core.enums.StrategyType;

/**
 * Created by xuxiaoming005 on 2018-08-22.
 */
public class DesensitizationPolicyFactory {

    public static DesensitizationPolicy getPolicy(String type) {
        DesensitizationPolicy policy = new DesensitizationPolicyJsonImprovementImpl();

        if (StrategyType.JSON_RAW.equals(type)) {
            policy = new DesentizationPolicyImpl();
        } else if (StrategyType.JSON_IMPROVE.equals(type)) {
            policy = new DesensitizationPolicyJsonImprovementImpl();
        } else if (StrategyType.REGEX.equals(type)){
            policy = new DesensitizationPolicyRegexImpl();
        }

        return policy;
    }
}
